package com.authine.cloudpivot.ext.dto.model.bill;

import com.authine.mvp.app.launcher.domain.SelectorFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Builder
@Schema(description = "账单记录表对象")
public class Bill {

    @Schema(description = "id")
    private String id;

    @Schema(description = "交易id")
    private String trade_id;

    @Schema(description = "隶属于的目标id")
    private String target_id;

    @Schema(description = "方向：销售、采购")
    private String direction;

    @Schema(description = "业务类型：普通订单、代购订单")
    private String business_type;

    /**
     * 1、正常商品账单对应订单模块传递过来的收货记录ID唯一值
     * 2、结算生成服务费账单，保存结算明细的id
     */
    @Schema(description = "来源id")
    private String reference_id;

    @Schema(description = "客户订单id")
    private String customer_order_id;

    @Schema(description = "供应商订单id")
    private String vendor_order_id;

    @Schema(description = "订单商品id")
    private String order_goods_id;

    @Schema(description = "组织")
    private SelectorFormat organization_id;

    @Schema(description = "账单类型")
    private String type;

    @Schema(description = "商品摘要")
    private String summary;

    @Schema(description = "账单日期")
    private Date bill_date;

    @Schema(description = "客户或供应商组织名称")
    @JsonProperty("organizationName")
    private String organization_name;

    @Schema(description = "数量")
    private BigDecimal quantity;

    @Schema(description = "可核销数量")
    private BigDecimal offset_quantity;

    @Schema(description = "含税单价")
    private BigDecimal price;

    @Schema(description = "未税单价")
    private BigDecimal pretax_price;

    @Schema(description = "账单税率")
    private BigDecimal tax_rate;

    @Schema(description = "总计（含税）")
    private BigDecimal total;

    @Schema(description = "单位")
    private String unit;

    /**
     * 收货创建账单使用
     * true=已收货退款（存在账单），false=仅退款不需要退货
     */
    private Boolean refundNonExist;

    /****************** 供应商服务费发票待申请冗余字段 ******************/

    @Schema(description = "发票号码")
    private String invoice_number;
    @Schema(description = "结算单号")
    private String settle_ids;
    @Schema(description = "结算金额")
    private BigDecimal settle_amount;
    @Schema(description = "结算时间")
    private String settle_time;
    @Schema(description = "平台组织名称")
    private String platform_organization_name;




}
